import { invoke } from '@tauri-apps/api/core';

export async function convertToMarkdown(files: string[], outputDir: string) {
  for (const file of files) {
    try {
      const result = await invoke('convert_to_markdown', {
        inputPath: file,
        outputPath: outputDir
      });
      console.log(`转换结果: ${JSON.stringify(result)}`);
    } catch (error) {
      console.error(`转换文件 ${file} 失败:`, error);
      throw error;
    }
  }
} 